import { ChangeDetectionStrategy, Component, Input, OnInit, Output,EventEmitter } from '@angular/core';
import { SongSheet } from 'src/app/services/data-types/common.types';

@Component({
  selector: 'app-single-sheet',
  templateUrl: './single-sheet.component.html',
  styleUrls: ['./single-sheet.component.less'],
  changeDetection:ChangeDetectionStrategy.OnPush
})
export class SingleSheetComponent implements OnInit {
  @Input() sheet!: SongSheet;
  @Output() onPlay = new EventEmitter<number>()
  constructor() { }

  ngOnInit(): void {
  }
  playSheet(ent: MouseEvent ,id:number){
    ent.stopPropagation()
    this.onPlay.emit(id)
  }
  get coverImg(): string {
    return this.sheet.picUrl || this.sheet.coverImgUrl
  }
}
